/*
 * MusicLabs, Copyright (C) 2008-2009 Felippe Ragghianti
 * http://code.google.com/p/musiclabs
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 */

package br.com.music;

/* TODO: consider using 'coma' as fundamental unit instead? */
/* TODO: implement diminished (d), augmented (A), minor (m), major (M) and just
   (j) interval abstractions. */
/* TODO: implement vertical and linear intervals. */
/* TODO: implement diatonic and chromatic interval recognition. */

/**
 * This class represents the relation between the pitches of two notes.
 * There are two fundamental intervals: tones and semitones. One tone is
 * composed by two semitones, as usual.
 *
 * @version $LastChangedRevision$
 */
public enum Interval {

    TONE(2),
    SEMITONE(1);

    private int semitones;

    /**
     * Class constructor.
     *
     * @param semitones Number of semitones that the interval encopasses.
     */
    private Interval(int semitones) {
        this.semitones = semitones;
    }

    /**
     * Convert interval to an integer representing the number of embraced
     * semitones.
     *
     * @return The size of the interval in semitones (integer).
     */
    public int toSemitones() {
        return semitones;
    }
}